<template>
  <div class="parent">
    <h3>父组件</h3>
		<h4>我的车：{{car}}</h4>
		<h4 v-show="wanju">子给的玩具：{{wanju}}</h4>
		<Child :che="car" :sendToy="saveToy"/>
  </div>
</template>

<script>
	import Child from './Child.vue'
	
	export default {
		name: 'Index',
		components: {Child},
		data() {
			return {
				car:'奔驰',
				wanju:''
			}
		},
		methods: {
			saveToy(value){
				this.wanju = value
			}
		},
	}
</script>

<style lang="less" scoped>
	.parent{
		background-color:rgb(165, 164, 164);
		padding: 20px;
		border-radius: 10px;
	}
</style>